const Mock = require('mockjs')

let Result = {
    code: 20000,
    message: '操作成功',
    data: null,
}

const Random = Mock.Random

Mock.mock('/api/captchea', 'get', () => {
    Result.code = 20000
    Result.message = '验证码请求成功'
    Result.data = {
        key: Random.string(32),
        captchaImg: Random.dataImage('120x40', '5sw8A')
    }
    return Result
})

Mock.mock('/api/login', 'post', () => {
    console.log('mock模拟登录');
    Result.code = 20000
    Result.message = '登录成功'
    return Result
})

// 修改用户密码
Mock.mock('/api/updatePass', 'post', () => {
    Result.code = 20000
    Result.message = '修改密码成功'
    return Result
})

Mock.mock('/menu/nav', 'get', () => {
    let nav = [
        {
            id: 1,
            title: '系统管理',
            icon: 'el-icon-s-operation',
            path: '',
            name: 'sys:manage',
            perms: null,
            component: '',
            children: [
                {
                    id: 2,
                    title: '用户管理',
                    icon: 'el-icon-s-custom',
                    path: '/sys/users',
                    name: 'sys:user:list',
                    perms: null,
                    component: 'system/User',
                    children: [],
                },
                {
                    id: 3,
                    title: '角色管理',
                    icon: 'el-icon-rank',
                    path: '/sys/roles',
                    name: 'sys:role:list',
                    perms: null,
                    component: 'system/Roles',
                    children: [],
                },
                {
                    id: 4,
                    title: '菜单管理',
                    icon: 'el-icon-menu',
                    path: '/sys/menus',
                    name: 'sys:menu:list',
                    perms: null,
                    component: 'system/Menu',
                    children: [],
                },
            ],
        },
        {
            id: 5,
            title: '数据管理',
            icon: 'el-icon-s-tools',
            path: '',
            name: 'sys:tools',
            perms: null,
            component: null,
            children: [
                {
                    id: 40,
                    title: '数据展示',
                    icon: 'el-icon-bangzhu',
                    path: '/userCenter',
                    name: 'sys:dataShow:list',
                    perms: null,
                    component: 'UserCenter',
                    children: [],
                },

            ],
        },
        {
            id: 26,
            title: '影院管理',
            icon: 'el-icon-s-operation',
            path: null,
            name: 'sys:mv:manager',
            perms: null,
            component: null,
            children: [
                {
                    id: 59,
                    title: "周边商品管理",
                    icon: "el-icon-shopping-bag-1",
                    path: "/sys/product",
                    name: "sys:product:list",
                    perms: null,
                    component: "system/Product",
                    children: [],
                },
                {
                    id: 27,
                    title: '类别管理',
                    icon: 'el-icon-menu',
                    path: '/sys/category',
                    name: 'sys:type:list',
                    perms: null,
                    component: 'system/Category',
                    children: [],
                },
                {
                    id: 32,
                    title: '排片管理',
                    icon: 'el-icon-s-promotion',
                    path: '/sys/arrangement',
                    name: 'sys:arrangement',
                    perms: null,
                    component: 'system/arrangement',
                    children: [],
                },
                {
                    id: 33,
                    title: '轮播图管理',
                    icon: 'el-icon-picture-outline',
                    path: '/sys/poster',
                    name: 'sys:poster:list',
                    perms: null,
                    component: 'system/Poster',
                    children: [],
                },
                {
                    id: 34,
                    title: '电影管理',
                    icon: 'el-icon-s-promotion',
                    path: '/sys/film',
                    name: 'sys:film:list',
                    perms: null,
                    component: 'system/Film',
                    children: [],
                },
            ],
        },
        {
            id: 39,
            title: '前台用户管理',
            icon: 'el-icon-s-custom',
            path: null,
            name: 'sys;fans:list',
            perms: null,
            component: null,
            children: [
                {
                    id: 31,
                    title: '粉丝管理',
                    icon: 'el-icon-s-promotion',
                    path: '/sys/fans',
                    name: 'sys:fans:list',
                    perms: null,
                    component: 'system/Fans',
                    children: [],
                },
                {
                    id: 35,
                    title: '电影评论管理',
                    icon: 'el-icon-date',
                    path: '/sys/evaluate',
                    name: 'sys:evaluate:list',
                    perms: null,
                    component: 'system/Evaluate',
                    children: [],
                },
                {
                    id: 50,
                    title: '黑名单用户管理',
                    icon: 'el-icon-user-solid',
                    path: '/sys/blacklist',
                    name: 'sys:blacklist:list',
                    perms: null,
                    component: 'system/Blacklist',
                    children: [],
                },
                {
                    id: 36,
                    title: '订单管理',
                    icon: 'el-icon-folder-checked',
                    path: '/sys/order',
                    name: 'sys:order:list',
                    perms: null,
                    component: 'system/Order',
                    children: [],
                },
            ],
        },
    ]
    //定义数组，返回是权限数组
    let authoritys = [
        'ROLE_normal',
        'ROLE_admin',
        'sys:manage',
        'sys:user:list',
        'sys:role:list',
        'sys:menu:list',
        'sys:tools',
        'sys:role:save',
        'sys:user:save',
        'sys:user:update',
        'sys:user:delete',
        'sys:user:role',
        'sys:user:repass',
        'sys:role:update',
        'sys:role:delete',
        'sys:role:perm',
        'sys:menu:save',
        'sys:menu:update',
        'sys:menu:delete',
        'sys:mv:manager',
        'sys:type:list',
        'sys:type:save',
        'sys:type:update',
        'sys:type:delete',
        'sys:fans:list',
        'sys:arrangement',
        'sys:poster:list',
        'sys:film:list',
        'sys:evaluate:list',
        'sys:order:list',
        'sys;fans:list',
        'sys:dataShow:list',
    ]
    Result.code = 20000
    Result.message = '菜单数据请求成功'
    Result.data = {nav: nav, authoritys: authoritys}
    return Result
})


Mock.mock(RegExp('/user/userinfo/*'), 'get', () => {
    Result.code = 20000,
        Result.message = '查询用户信息成功'
    Result.data = {
        id: 1,
        username: 'byy',
        avatar: 'https://pic3.zhimg.com/v2-24c4f95ab345171dc356cc611852dfea_r.jpg',
        email: ''
    }
    return Result
})

///获得所有用户的信息////
//实际请求:  /system/user/list/2
Mock.mock(RegExp('/system/user/list*'), 'get', () => {
    Result.code = 20000
    Result.message = '请求用户数据成功'
    Result.data = {
        records: [
            {
                id: 1,
                created: '2021-01-12T22:13:53',
                updated: '2021-01-16T16:57:32',
                statu: 1,
                username: 'admin',
                password:
                    '$2a$10$oPaOFhl1IYrUgHj3kcpW7OJYR9N9wGudceRdNVIs8aSY4Q7rLCGuK', //123123
                avatar:
                    'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fc-ssl.duitang.com%2Fuploads%2Fblog%2F202107%2F09%2F20210709142454_dc8dc.thumb.1000_0.jpeg&refer=http%3A%2F%2Fc-ssl.duitang.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1666333236&t=3733d94221afc7ea3189dc0ffa30fd47',
                email: '999@qq.com',
                tel: '15343517807',
                lastLogin: '2020-12-30T08:38:37',
                roles: [
                    {
                        id: 6,
                        created: '2021-01-16T13:29:03',
                        updated: '2021-01-17T15:50:45',
                        statu: 1,
                        name: '超级管理员',
                        code: 'admin',
                        remark: '系统默认最高权限，不可以编辑和任意修改',
                        menuIds: [],
                    },
                    {
                        id: 3,
                        created: '2021-01-04T10:09:14',
                        updated: '2021-01-30T08:19:52',
                        statu: 1,
                        name: '普通用户',
                        code: 'normal',
                        remark: '只有基本查看功能',
                        menuIds: [],
                    },
                ],
            },
            {
                id: 2,
                created: '2021-01-30T08:20:22',
                updated: '2021-01-30T08:55:57',
                statu: 0,
                username: 'test',
                password:
                    '$2a$10$oPaOFhl1IYrUgHj3kcpW7OJYR9N9wGudceRdNVIs8aSY4Q7rLCGuK',
                avatar:
                    'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fc-ssl.duitang.com%2Fuploads%2Fitem%2F201908%2F19%2F20190819150344_ALnaX.thumb.1000_0.jpeg&refer=http%3A%2F%2Fc-ssl.duitang.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1666333236&t=a23b8c8c9f154ea09f54728b6e04e7f9',
                email: 'test@qq.com',
                tel: 133667788899,
                lastLogin: null,
                roles: [
                    {
                        id: 3,
                        created: '2021-01-04T10:09:14',
                        updated: '2021-01-30T08:19:52',
                        statu: 1,
                        name: '普通用户',
                        code: 'normal',
                        remark: '只有基本查看功能',
                        menuIds: [],
                    },
                ],
            },
        ],
        total: 2,
        size: 10,
        current: 1,
        orders: [],
        optimizeCountSql: true,
        hitCount: false,
        countId: null,
        maxLimit: null,
        searchCount: true,
        pages: 1,
    }
    return Result
})


Mock.mock('/system/user/delete', 'post', () => {
    Result.code = 20000
    Result.message = '删除用户信息成功'
    Result.data = null
    return Result
})

Mock.mock('/system/user/save', 'post', () => {
    Result.code = 20000
    Result.message = '新建用户信息成功'
    Result.data = null
    return Result
})

Mock.mock('/system/user/update', 'post', () => {
    Result.code = 20000
    Result.message = '更新用户信息成功'
    Result.data = null
    return Result
})


Mock.mock(RegExp('/user/userInfo/*'), 'get', () => {
    Result.code = 20000,
        Result.message = '查询用户详细信息成功'
    Result.data = {
        id: 1,
        username: 'admin',
        avatar:
            'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fc-ssl.duitang.com%2Fuploads%2Fblog%2F202107%2F09%2F20210709142454_dc8dc.thumb.1000_0.jpeg&refer=http%3A%2F%2Fc-ssl.duitang.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1666333236&t=3733d94221afc7ea3189dc0ffa30fd47',
        email: '999@qq.com',
        tel: '15343517807',
    }
    return Result
})

Mock.mock('/system/user/repass', 'post', () => {
    Result.code = 20000
    Result.message = '重置密码操作成功'
    Result.data = null
    return Result
})

//模拟请求服务器，返回数据库中所有 角色的信息
Mock.mock(RegExp('/system/role/list*'), 'get', () => {
    Result.code = 20000
    Result.message = '请求角色列表信息成功'
    Result.data = {
        records: [
            {
                id: 3,
                created: '2021-01-04T10:09:14',
                updated: '2021-01-30T08:19:52',
                statu: 1,
                name: '普通用户',
                code: 'normal',
                remark: '只有基本查看功能',
                menuIds: [],
            },
            {
                id: 6,
                created: '2021-01-16T13:29:03',
                updated: '2021-01-17T15:50:45',
                statu: 0,
                name: '超级管理员',
                code: 'admin',
                remark: '系统默认最高权限，不可以编辑和任意修改 ',
                menuIds: [],
            },
        ],
        total: 2,
        size: 10,
        current: 1,
        orders: [],
        optimizeCountSql: true,
        hitCount: false,
        countId: null,
        maxLimit: null,
        searchCount: true,
        pages: 1,
    }
    return Result
})

Mock.mock('/system/role/delete', 'post', () => {
    Result.code = 20000
    Result.message = '删除权限信息成功'
    Result.data = null
    return Result
})

Mock.mock('/system/role/save', 'post', () => {
    Result.code = 20000
    Result.message = '新建角色信息成功'
    Result.data = null
    return Result
})

Mock.mock('/system/role/update', 'post', () => {
    Result.code = 20000
    Result.message = '更新角色信息成功'
    Result.data = null
    return Result
})

Mock.mock(RegExp('/role/userInfo/*'), 'get', () => {
    Result.code = 20000,
        Result.message = '查询角色详细信息成功'
    Result.data = {
        id: 3,
        created: '2021-01-04T10:09:14',
        updated: '2021-01-30T08:19:52',
        statu: 1,
        name: '普通用户',
        code: 'normal',
        remark: '只有基本查看功能',
        menuIds: [],
    }
    return Result
})


//模拟请求Java服务器，获得所有的菜单数据
Mock.mock('/system/menu/list', 'get', () => {
    let menus = [
        {
            id: 1,
            created: '2022-11-03T18:58:18',
            updated: '2022-11-03T18:58:18',
            statu: 1,
            parentId: 0,
            name: '系统管理',
            path: '',
            perms: 'sys:manage',
            component: '',
            type: 0,
            icon: 'el-icon-s-operation',
            ordernum: 1,
            children: [
                {
                    id: 2,
                    created: '2022-11-03T18:58:18',
                    updated: '2022-11-03T18:58:18',
                    statu: 1,
                    parentId: 1,
                    name: '用户管理',
                    path: '/sys/users',
                    perms: 'sys:user:list',
                    component: 'sys/User',
                    type: 1,
                    icon: 'el-icon-s-custom',
                    ordernum: 1,
                    children: [
                        {
                            id: 9,
                            created: '2022-11-03T18:58:18',
                            updated: null,
                            statu: 1,
                            parentId: 2,
                            name: '添加用户',
                            path: null,
                            perms: 'sys:user:save',
                            component: null,
                            type: 2,
                            icon: null,
                            ordernum: 1,
                            children: [],
                        },
                        {
                            id: 10,
                            created: '2022-11-03T18:58:18',
                            updated: '2022-11-03T18:58:18',
                            statu: 1,
                            parentId: 2,
                            name: '修改用户',
                            path: null,
                            perms: 'sys:user:update',
                            component: null,
                            type: 2,
                            icon: null,
                            ordernum: 2,
                            children: [],
                        },
                        {
                            id: 11,
                            created: '2022-11-03T18:58:18',
                            updated: null,
                            statu: 1,
                            parentId: 2,
                            name: '删除用户',
                            path: null,
                            perms: 'sys:user:delete',
                            component: null,
                            type: 2,
                            icon: null,
                            ordernum: 3,
                            children: [],
                        },
                        {
                            id: 12,
                            created: '2022-11-03T18:58:18',
                            updated: null,
                            statu: 1,
                            parentId: 2,
                            name: '分配角色',
                            path: null,
                            perms: 'sys:user:role',
                            component: null,
                            type: 2,
                            icon: null,
                            ordernum: 4,
                            children: [],
                        },
                        {
                            id: 13,
                            created: '2022-11-03T18:58:18',
                            updated: null,
                            statu: 1,
                            parentId: 2,
                            name: '重置密码',
                            path: null,
                            perms: 'sys:user:repass',
                            component: null,
                            type: 2,
                            icon: null,
                            ordernum: 5,
                            children: [],
                        },
                    ],
                },
                {
                    id: 3,
                    created: '2022-11-03T18:58:18',
                    updated: '2022-11-03T18:58:18',
                    statu: 1,
                    parentId: 1,
                    name: '角色管理',
                    path: '/sys/roles',
                    perms: 'sys:role:list',
                    component: 'sys/Role',
                    type: 1,
                    icon: 'el-icon-rank',
                    ordernum: 2,
                    children: [
                        {
                            id: 7,
                            created: '2022-11-03T18:58:18',
                            updated: '2022-11-03T18:58:18',
                            statu: 0,
                            parentId: 3,
                            name: '添加角色',
                            path: '',
                            perms: 'sys:role:save',
                            component: '',
                            type: 2,
                            icon: '',
                            ordernum: 1,
                            children: [],
                        },
                        {
                            id: 14,
                            created: '2022-11-03T18:58:18',
                            updated: null,
                            statu: 1,
                            parentId: 3,
                            name: '修改角色',
                            path: null,
                            perms: 'sys:role:update',
                            component: null,
                            type: 2,
                            icon: null,
                            ordernum: 2,
                            children: [],
                        },
                        {
                            id: 15,
                            created: '2022-11-03T18:58:18',
                            updated: null,
                            statu: 1,
                            parentId: 3,
                            name: '删除角色',
                            path: null,
                            perms: 'sys:role:delete',
                            component: null,
                            type: 2,
                            icon: null,
                            ordernum: 3,
                            children: [],
                        },
                        {
                            id: 16,
                            created: '2022-11-03T18:58:18',
                            updated: null,
                            statu: 1,
                            parentId: 3,
                            name: '分配权限',
                            path: null,
                            perms: 'sys:role:perm',
                            component: null,
                            type: 2,
                            icon: null,
                            ordernum: 5,
                            children: [],
                        },
                    ],
                },
                {
                    id: 4,
                    created: '2022-11-03T18:58:18',
                    updated: '2022-11-03T18:58:18',
                    statu: 1,
                    parentId: 1,
                    name: '菜单管理',
                    path: '/sys/menus',
                    perms: 'sys:menu:list',
                    component: 'sys/Menu',
                    type: 1,
                    icon: 'el-icon-menu',
                    ordernum: 3,
                    children: [
                        {
                            id: 17,
                            created: '2022-11-03T18:58:18',
                            updated: '2022-11-03T18:58:18',
                            statu: 1,
                            parentId: 4,
                            name: '添加菜单',
                            path: null,
                            perms: 'sys:menu:save',
                            component: null,
                            type: 2,
                            icon: null,
                            ordernum: 1,
                            children: [],
                        },
                        {
                            id: 18,
                            created: '2022-11-03T18:58:18',
                            updated: null,
                            statu: 1,
                            parentId: 4,
                            name: '修改菜单',
                            path: null,
                            perms: 'sys:menu:update',
                            component: null,
                            type: 2,
                            icon: null,
                            ordernum: 2,
                            children: [],
                        },
                        {
                            id: 19,
                            created: '2022-11-03T18:58:18',
                            updated: null,
                            statu: 1,
                            parentId: 4,
                            name: '删除菜单',
                            path: null,
                            perms: 'sys:menu:delete',
                            component: null,
                            type: 2,
                            icon: null,
                            ordernum: 3,
                            children: [],
                        },
                    ],
                },
            ],
        },
        {
            id: 5,
            created: '2022-11-03T18:58:18',
            updated: '2022-12-13T17:39:32',
            statu: 1,
            parentId: 0,
            name: '数据管理',
            path: '',
            perms: 'sys:tools',
            component: null,
            type: 0,
            icon: 'el-icon-s-tools',
            ordernum: 2,
            children: [
                {
                    id: 40,
                    created: '2022-12-13T17:43:50',
                    updated: null,
                    statu: 1,
                    parentId: 5,
                    name: '数据展示',
                    path: '/userCenter',
                    perms: 'sys:dataShow:list',
                    component: 'UserCenter',
                    type: 1,
                    icon: 'el-icon-bangzhu',
                    ordernum: 1,
                    children: [],
                },
            ],
        },
        {
            id: 26,
            created: '2022-12-07T17:44:57',
            updated: null,
            statu: 1,
            parentId: 0,
            name: '影院管理',
            path: null,
            perms: 'sys:mv:manager',
            component: null,
            type: 0,
            icon: 'el-icon-s-operation',
            ordernum: 1,
            children: [
                {
                    id: 27,
                    created: '2022-12-07T17:50:06',
                    updated: '2022-12-07T17:52:24',
                    statu: 1,
                    parentId: 26,
                    name: '类别管理',
                    path: '/sys/category',
                    perms: 'sys:type:list',
                    component: 'sys/Category',
                    type: 1,
                    icon: 'el-icon-s-operation',
                    ordernum: 1,
                    children: [
                        {
                            id: 28,
                            created: '2022-12-07T19:10:07',
                            updated: '2022-12-08T16:20:38',
                            statu: 1,
                            parentId: 27,
                            name: '分类增加',
                            path: null,
                            perms: 'sys:type:save',
                            component: null,
                            type: 2,
                            icon: null,
                            ordernum: 1,
                            children: [],
                        },
                        {
                            id: 29,
                            created: '2022-12-07T19:10:40',
                            updated: '2022-12-08T16:20:55',
                            statu: 1,
                            parentId: 27,
                            name: '分类修改',
                            path: null,
                            perms: 'sys:type:update',
                            component: null,
                            type: 2,
                            icon: null,
                            ordernum: 1,
                            children: [],
                        },
                        {
                            id: 30,
                            created: '2022-12-07T19:11:00',
                            updated: '2022-12-08T16:21:07',
                            statu: 1,
                            parentId: 27,
                            name: '分类删除',
                            path: null,
                            perms: 'sys:type:delete',
                            component: null,
                            type: 2,
                            icon: null,
                            ordernum: 1,
                            children: [],
                        },
                    ],
                },
                {
                    id: 32,
                    created: '2022-12-08T16:18:02',
                    updated: null,
                    statu: 1,
                    parentId: 26,
                    name: '排片管理',
                    path: '/sys/arrangement',
                    perms: 'sys:arrangement',
                    component: 'sys/arrangement',
                    type: 1,
                    icon: 'el-icon-s-promotion',
                    ordernum: 1,
                    children: [],
                },
                {
                    id: 33,
                    created: '2022-12-08T16:19:08',
                    updated: '2022-12-08T21:30:14',
                    statu: 1,
                    parentId: 26,
                    name: '轮播图管理',
                    path: '/sys/poster',
                    perms: 'sys:poster:list',
                    component: 'sys/Poster',
                    type: 1,
                    icon: 'el-icon-s-promotion',
                    ordernum: 1,
                    children: [],
                },
                {
                    id: 34,
                    created: '2022-12-08T16:19:55',
                    updated: '2022-12-08T22:00:47',
                    statu: 1,
                    parentId: 26,
                    name: '电影管理',
                    path: '/sys/film',
                    perms: 'sys:film:list',
                    component: 'sys/Film',
                    type: 1,
                    icon: 'el-icon-s-promotion',
                    ordernum: 1,
                    children: [],
                },
            ],
        },
        {
            id: 39,
            created: '2022-12-11T21:35:22',
            updated: '2022-12-11T21:37:25',
            statu: 1,
            parentId: 0,
            name: '前台用户管理',
            path: null,
            perms: 'sys;fans:list',
            component: null,
            type: 1,
            icon: 'el-icon-s-custom',
            ordernum: 1,
            children: [
                {
                    id: 31,
                    created: '2022-12-08T16:16:16',
                    updated: '2022-12-11T21:35:33',
                    statu: 1,
                    parentId: 39,
                    name: '粉丝管理',
                    path: '/sys/fans',
                    perms: 'sys:fans:list',
                    component: 'sys/Fans',
                    type: 1,
                    icon: 'el-icon-s-promotion',
                    ordernum: 1,
                    children: [],
                },
                {
                    id: 35,
                    created: '2022-12-10T07:27:42',
                    updated: '2022-12-11T21:35:46',
                    statu: 1,
                    parentId: 39,
                    name: '电影评论管理',
                    path: '/sys/evaluate',
                    perms: 'sys:evaluate:list',
                    component: 'sys/Evaluate',
                    type: 1,
                    icon: 'el-icon-date',
                    ordernum: 1,
                    children: [],
                },
                {
                    id: 36,
                    created: '2022-12-10T07:29:02',
                    updated: '2022-12-11T21:35:55',
                    statu: 1,
                    parentId: 39,
                    name: '订单管理',
                    path: '/sys/order',
                    perms: 'sys:order:list',
                    component: 'sys/Order',
                    type: 1,
                    icon: 'el-icon-folder-checked',
                    ordernum: 1,
                    children: [],
                },
            ],
        },
    ]
    Result.code = 20000
    Result.message = '请求菜单数据成功'
    Result.data = menus

    return Result
})

Mock.mock(RegExp('/menu/userInfo/*'), 'get', () => {
    Result.code = 20000,
        Result.message = '查询菜单详细信息成功'
    Result.data = {
        id: 2,
        created: '2022-11-03T18:58:18',
        updated: '2022-11-03T18:58:18',
        statu: 1,
        parentId: 1,
        name: '用户管理',
        path: '/sys/users',
        perms: 'sys:user:list',
        component: 'sys/User',
        type: 1,
        icon: 'el-icon-s-custom',
        ordernum: 1,
        children: [
            {
                id: 9,
                created: '2022-11-03T18:58:18',
                updated: null,
                statu: 1,
                parentId: 2,
                name: '添加用户',
                path: null,
                perms: 'sys:user:save',
                component: null,
                type: 2,
                icon: null,
                ordernum: 1,
                children: [],
            },
            {
                id: 10,
                created: '2022-11-03T18:58:18',
                updated: '2022-11-03T18:58:18',
                statu: 1,
                parentId: 2,
                name: '修改用户',
                path: null,
                perms: 'sys:user:update',
                component: null,
                type: 2,
                icon: null,
                ordernum: 2,
                children: [],
            },
            {
                id: 11,
                created: '2022-11-03T18:58:18',
                updated: null,
                statu: 1,
                parentId: 2,
                name: '删除用户',
                path: null,
                perms: 'sys:user:delete',
                component: null,
                type: 2,
                icon: null,
                ordernum: 3,
                children: [],
            },
            {
                id: 12,
                created: '2022-11-03T18:58:18',
                updated: null,
                statu: 1,
                parentId: 2,
                name: '分配角色',
                path: null,
                perms: 'sys:user:role',
                component: null,
                type: 2,
                icon: null,
                ordernum: 4,
                children: [],
            },
            {
                id: 13,
                created: '2022-11-03T18:58:18',
                updated: null,
                statu: 1,
                parentId: 2,
                name: '重置密码',
                path: null,
                perms: 'sys:user:repass',
                component: null,
                type: 2,
                icon: null,
                ordernum: 5,
                children: [],
            },
        ],
    }
    return Result
})

Mock.mock('/system/menu/save', 'post', () => {
    Result.code = 20000
    Result.message = '新建菜单信息成功'
    Result.data = null
    return Result
})

Mock.mock('/system/menu/update', 'post', () => {
    Result.code = 20000
    Result.message = '更新菜单信息成功'
    Result.data = null
    return Result
})

Mock.mock('/system/menu/delete', 'post', () => {
    Result.code = 20000
    Result.message = '删除菜单信息成功'
    Result.data = null
    return Result
})

Mock.mock('/system/order/delete', 'post', () => {
    Result.code = 20000
    Result.message = '删除订单成功'
    Result.data = null
    return Result
})
Mock.mock(RegExp('/system/order/list*'), 'get', () => {
    Result.code = 20000
    Result.message = '请求订单信息成功'
    Result.data = {
        records: [
            {
                id: 7,
                aid: '懒羊羊',
                uid: 13665892714,
                movie: '汪汪队立大功',
                seats: '4排9座,4排8座',
                start: '2022-12-16',
                price: '160',
                statu: 0,
                created: '2022-12-10T23:38:00',
                pay_at: '2022-12-12T11:12:41',
            },
            {
                id: 8,
                aid: '喜羊羊',
                uid: 13665892714,
                movie: '汪汪队立大功',
                seats: '4排4座,1排1座',
                start: '2022-12-16',
                price: '160',
                statu: 1,
                created: '2022-12-10T23:38:00',
                pay_at: '2022-12-12T11:13:40',
            },
            {
                id: 9,
                aid: '美羊羊',
                uid: 13665892714,
                movie: '汪汪队立大功',
                seats: '1排8座,1排9座',
                start: '2022-12-16',
                price: '160',
                statu: 1,
                created: '2022-12-13T23:38:00',
                pay_at: '2022-12-12T11:13:52',
            },
            {
                id: 10,
                aid: '沸羊羊',
                uid: 13665892714,
                movie: '汪汪队立大功',
                seats: '3排6座,3排7座',
                start: '2022-12-15',
                price: '160',
                statu: 1,
                created: '2022-12-11T23:38:00',
                pay_at: '2022-12-12T11:14:07',
            },
            {
                id: 11,
                aid: '暖羊羊',
                uid: 13665892714,
                movie: '汪汪队立大功',
                seats: '4排6座,4排7座',
                start: '2022-12-13',
                price: '160',
                statu: 0,
                created: '2022-12-10T23:38:00',
                pay_at: '2022-12-12T11:17:41',
            },
            {
                id: 12,
                aid: '慢羊羊',
                uid: 13665892714,
                movie: '汪汪队立大功',
                seats: '4排8座,1排9座',
                start: '2022-12-16',
                price: '160',
                statu: 1,
                created: '2022-12-10T23:38:00',
                pay_at: '2022-12-12T11:18:40',
            },
            {
                id: 13,
                aid: '灰太狼',
                uid: 13665892714,
                movie: '汪汪队立大功',
                seats: '3排9座,3排8座',
                start: '2022-12-16',
                price: '160',
                statu: 0,
                created: '2022-12-10T23:38:00',
                pay_at: '2022-12-12T11:13:41',
            },
            {
                id: 14,
                aid: '红太狼',
                uid: 13665892714,
                movie: '汪汪队立大功',
                seats: '2排5座,1排5座',
                start: '2022-12-16',
                price: '160',
                statu: 1,
                created: '2022-12-10T23:38:00',
                pay_at: '2022-12-12T11:13:47',
            },
            {
                id: 15,
                aid: '小灰灰',
                uid: 13665892714,
                movie: '汪汪队立大功',
                seats: '6排9座,6排8座',
                start: '2022-12-16',
                price: '160',
                statu: 0,
                created: '2022-12-10T23:38:00',
                pay_at: '2022-12-12T11:12:49',
            },
            {
                id: 16,
                aid: '蕉太狼',
                uid: 13665892714,
                movie: '汪汪队立大功',
                seats: '1排4座,1排6座',
                start: '2022-12-16',
                price: '160',
                statu: 1,
                created: '2022-12-10T23:38:00',
                pay_at: '2022-12-12T11:13:49',
            },
        ],
        total: 10,
        size: 10,
        current: 1,
        orders: [],
        optimizeCountSql: true,
        hitCount: false,
        countId: null,
        maxLimit: null,
        searchCount: true,
        pages: 1,
    }

    return Result
})


// 生成随机整数函数
const getRandomInt = (min, max) => {
    return Math.floor(Math.random() * (max - min + 1) + min);
};

// 生成随机小数函数
const getRandomFloat = (max, precision = 1) => {
    const ratio = Math.pow(100, precision);
    return Math.floor(Math.random() * max * ratio) / ratio;
};

// 生成电影列表数据
const filmList = [];
const regions = ['中国', '美国', '日本', '韩国', '英国', '法国', '德国', '意大利'];
const categories = ['动作', '喜剧', '爱情', '科幻', '恐怖', '剧情'];
for (let i = 1; i <= 10; i++) {
    const color = '#' + Random.integer(180, 255).toString(16) +
        Random.integer(140, 255).toString(16) +
        Random.integer(120, 220).toString(16)
    const film = Mock.mock({
        id: 1,
        name: `电影${i}`,
        release_time: Mock.Random.date('yyyy-MM-dd'),
        category_id: getRandomInt(1, categories.length),
        region: regions[getRandomInt(0, regions.length - 1)],
        cover: Mock.Random.image('300x140', color, ' ^_^ '),
        duration: getRandomInt(60, 180),
        statu: getRandomInt(0, 1),
        grade: getRandomFloat(5, 1),
    });
    filmList.push(film);
}

// 返回电影列表数据
Mock.mock('/system/film/list', 'get', () => {
    Result.code = 20000
    Result.message = '请求影片成功'
    Result.data = filmList
    return Result
});

Mock.mock('/system/film/delete', 'post', () => {
    Result.code = 20000
    Result.message = '删除影片信息成功'
    Result.data = null
    return Result
})

Mock.mock(RegExp('/film/userInfo/*'), 'get', () => {
    Result.code = 20000
    Result.message = '请求影片成功'
    Result.data = {
        id: 1,
        name: `电影`,
        release_time: Mock.Random.date('yyyy-MM-dd'),
        category_id: getRandomInt(1, categories.length),
        region: regions[getRandomInt(0, regions.length - 1)],
        cover: Mock.Random.image('300x140', '#999', ' FILM '),
        duration: getRandomInt(60, 180),
        statu: getRandomInt(0, 1),
        grade: getRandomFloat(3, 5, 1),
    }
    return Result
});

Mock.mock('/system/film/save', 'post', () => {
    Result.code = 20000
    Result.message = '新建影片信息成功'
    Result.data = null
    return Result
})

Mock.mock('/system/film/update', 'post', () => {
    Result.code = 20000
    Result.message = '更新影片信息成功'
    Result.data = null
    return Result
})


Mock.mock(RegExp('/system/blacklist/list*'), 'get', () => {
    Result.code = 20000
    Result.message = '请求黑名单用户成功'
    Result.data = {
        records: [
            {
                id: 1,
                created: '2021-01-12T22:13:53',
                blocked: '2021-01-16T16:57:32',
                statu: 0,
                name: 'admin2',
                avatar:
                    'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fc-ssl.duitang.com%2Fuploads%2Fitem%2F202007%2F21%2F20200721225542_2R83m.thumb.1000_0.jpeg&refer=http%3A%2F%2Fc-ssl.duitang.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1683274100&t=83962e9a2d56f5907365bf37c982b639',
                email: '123@qq.com',
                tel: '15343222807',
                lastLogin: '2020-12-30T08:38:37',
                blacklists: [
                    {
                        id: 8,
                        created: '2021-01-16T13:29:03',
                        blocked: '2021-01-17T15:50:45',
                        statu: 1,
                        name: '超级管理员',
                        code: 'admin',
                        remark: '系统默认最高权限，不可以编辑和任意修改',
                        menuIds: [],
                    },
                    {
                        id: 9,
                        created: '2021-01-04T10:09:14',
                        blocked: '2021-01-30T08:19:52',
                        statu: 1,
                        name: '普通用户',
                        code: 'normal',
                        remark: '只有基本查看功能',
                        menuIds: [],
                    },
                ],
            },
            {
                id: 2,
                created: '2021-01-30T08:20:22',
                blocked: '2021-01-30T08:55:57',
                statu: 0,
                name: 'badboy',
                avatar:
                    'https://img0.baidu.com/it/u=2270256597,1763841447&fm=253&fmt=auto&app=138&f=JPEG?w=501&h=500',
                email: '4658@qq.com',
                tel: 13366436899,
                lastLogin: null,
                blacklists: [
                    {
                        id: 3,
                        created: '2021-01-04T10:09:14',
                        blocked: '2021-01-30T08:19:52',
                        statu: 1,
                        name: '普通用户',
                        code: 'normal',
                        remark: '只有基本查看功能',
                        menuIds: [],
                    },
                ],
            },
            {
                id: 4,
                created: '2021-01-31T07:17:02',
                blocked: '2021-02-22T08:59:57',
                statu: 0,
                name: 'badchild',
                avatar:
                    'https://img0.baidu.com/it/u=1416645616,3472693811&fm=253&fmt=auto&app=138&f=JPEG?w=480&h=500',
                email: '46558@qq.com',
                tel: 13365436899,
                lastLogin: null,
                blacklists: [
                    {
                        id: 6,
                        created: '2021-03-04T10:09:14',
                        blocked: '2021-05-30T08:19:52',
                        statu: 1,
                        name: '普通用户',
                        code: 'normal',
                        remark: '只有基本查看功能',
                        menuIds: [],
                    },
                ],
            },
            {
                id: 5,
                created: '2021-08-30T09:27:12',
                blocked: '2021-09-22T11:35:57',
                statu: 0,
                name: 'badgirl',
                avatar:
                    'https://img2.baidu.com/it/u=1764313044,42117373&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
                email: '487558@qq.com',
                tel: 13366116899,
                lastLogin: null,
                blacklists: [
                    {
                        id: 0,
                        created: '2021-01-04T10:09:14',
                        blocked: '2021-01-30T08:19:52',
                        statu: 1,
                        name: '普通用户',
                        code: 'normal',
                        remark: '只有基本查看功能',
                        menuIds: [],
                    },
                ],
            },
        ],
        total: 4,
        size: 10,
        current: 1,
        orders: [],
        optimizeCountSql: true,
        hitCount: false,
        countId: null,
        maxLimit: null,
        searchCount: true,
        pages: 1,
    }
    return Result
})
Mock.mock('/system/blacklist/delete', 'post', () => {
    Result.code = 20000
    Result.message = '移出黑名单成功'
    Result.data = null
    return Result
})
Mock.mock('/system/blacklist/save', 'post', () => {
    Result.code = 20000
    Result.message = '加入黑名单成功'
    Result.data = null
    return Result
})


//类别信息
Mock.mock('/system/category/list', 'get', () => {
    Result.code = 20000
    Result.message = '请求类别数据成功'
    Result.data = {
        records: [
            {
                id: 1,
                parentId: 0,
                created: '2021-01-16T11:57:32',
                updated: '2023-01-16T16:57:32',
                statu: '使用中',
                name: 'Family 家庭片',
                avatar:
                    'https://tse1-mm.cn.bing.net/th/id/OIP-C.SIesngPHo1s3EaypNL_3wgAAAA?w=270&h=180&c=7&r=0&o=5&dpr=1.5&pid=1.7',
                cpercentage: 10,
                children: [],
            },
            {
                id: 2,
                parentId: 0,
                created: '2021-01-16T11:57:32',
                updated: '2023-01-16T16:57:32',
                statu: '使用中',
                name: 'Comedy 喜剧片',
                avatar:
                    'https://tse1-mm.cn.bing.net/th/id/OIP-C.ChB-eQHtZdGuNoLKTFIJjQAAAA?w=190&h=124&c=7&r=0&o=5&dpr=1.5&pid=1.7',
                cpercentage: 15,
                children: [],
            },
            {
                id: 3,
                parentId: 0,
                created: '2021-01-16T11:57:32',
                updated: '2023-01-16T16:57:32',
                statu: '未使用',
                name: 'Drama 戏剧片',
                avatar:
                    'https://tse2-mm.cn.bing.net/th/id/OIP-C.P_0KEjMcvNufsM5xEc7-4gHaEK?w=313&h=180&c=7&r=0&o=5&dpr=1.5&pid=1.7',
                cpercentage: 20,
                children: [],
            },
            {
                id: 4,
                parentId: 0,
                created: '2021-01-16T11:57:32',
                updated: '2023-01-16T16:57:32',
                statu: '使用中',
                name: 'Science Fiction 科幻片',
                avatar:
                    'https://tse3-mm.cn.bing.net/th/id/OIP-C.WZAc7n_cxaQ7LJ92A4cqFQHaEx?w=279&h=180&c=7&r=0&o=5&dpr=1.5&pid=1.7',
                cpercentage: 19,
                children: [
                    {
                        id: 12,
                        parentId: 1,
                        created: '2021-01-16T11:57:32',
                        updated: '2023-01-16T16:57:32',
                        statu: '未使用',
                        name: 'Sci-fi adventure film 科幻冒险片',
                        avatar:
                            'https://tse3-mm.cn.bing.net/th/id/OIP-C.q0n-dsJW_4BdGnfbQXPFGAHaEK?w=333&h=187&c=7&r=0&o=5&dpr=1.5&pid=1.7',
                        cpercentage: 43,
                        children: [],
                    },
                    {
                        id: 13,
                        parentId: 1,
                        created: '2021-01-16T11:57:32',
                        updated: '2023-01-16T16:57:32',
                        statu: '使用中',
                        name: 'Sci-fi action film 科幻动作片',
                        avatar:
                            'https://tse3-mm.cn.bing.net/th/id/OIP-C.24CDNGuva2Qs7s19-kuneAHaDn?w=298&h=170&c=7&r=0&o=5&dpr=1.5&pid=1.7',
                        cpercentage: 50,
                        children: [],
                    },
                    {
                        id: 14,
                        parentId: 1,
                        created: '2021-01-16T11:57:32',
                        updated: '2023-01-16T16:57:32',
                        statu: '未使用',
                        name: 'Sci-fi epic film 科幻史诗片',
                        avatar:
                            'https://tse1-mm.cn.bing.net/th/id/OIP-C.VTeRO2cMbDga5uWmnabafAHaDR?w=285&h=180&c=7&r=0&o=5&dpr=1.5&pid=1.7',
                        cpercentage: 80,
                        children: [],
                    },
                    {
                        id: 15,
                        parentId: 1,
                        created: '2021-01-16T11:57:32',
                        updated: '2023-01-16T16:57:32',
                        statu: '使用中',
                        name: 'Sci-fi disaster film 科幻灾难片',
                        avatar:
                            'https://tse4-mm.cn.bing.net/th/id/OIP-C.H3ZrAUrxnQdm_Y6PKDUqXAHaET?w=190&h=110&c=7&r=0&o=5&dpr=1.5&pid=1.7',
                        cpercentage: 10,
                        children: [],
                    },
                ],
            },
            {
                id: 5,
                parentId: 0,
                created: '2021-01-16T11:57:32',
                updated: '2023-01-16T16:57:32',
                statu: '未使用',
                name: 'Horror 恐怖片',
                avatar:
                    'https://tse3-mm.cn.bing.net/th/id/OIP-C.eVpK47Zp_4jSVztOBf4XzwHaEa?w=291&h=180&c=7&r=0&o=5&dpr=1.5&pid=1.7',
                cpercentage: 30,
                children: [
                    {
                        id: 16,
                        parentId: 1,
                        created: '2021-01-16T11:57:32',
                        updated: '2023-01-16T16:57:32',
                        statu: '未使用',
                        name: 'zombie 僵尸片 ',
                        avatar:
                            'https://tse3-mm.cn.bing.net/th/id/OIP-C.bykl7zYhrogwxJKwq7Qe6QHaD_?w=327&h=180&c=7&r=0&o=5&dpr=1.5&pid=1.7',
                        cpercentage: 18,
                        children: [],
                    },
                    {
                        id: 17,
                        parentId: 1,
                        created: '2021-01-16T11:57:32',
                        updated: '2023-01-16T16:57:32',
                        statu: '使用中',
                        name: 'Monster 怪物',
                        avatar:
                            'https://tse2-mm.cn.bing.net/th/id/OIP-C.4oIhI1qAijdGHycnia7RmgHaDJ?pid=ImgDet&rs=1',
                        cpercentage: 14,
                        children: [],
                    },
                    {
                        id: 18,
                        parentId: 1,
                        created: '2021-01-16T11:57:32',
                        updated: '2023-01-16T16:57:32',
                        statu: '使用中',
                        name: 'Ghost 鬼片',
                        avatar:
                            'https://tse1-mm.cn.bing.net/th/id/OIP-C.RyvtR_uP95M00FMLKj8gDAHaEL?w=308&h=180&c=7&r=0&o=5&dpr=1.5&pid=1.7',
                        cpercentage: 30,
                        children: [],
                    },
                ],
            },
            {
                id: 6,
                parentId: 0,
                created: '2021-01-16T11:57:32',
                updated: '2023-01-16T16:57:32',
                statu: '未使用',
                name: 'Romance 爱情片',
                avatar:
                    'https://tse3-mm.cn.bing.net/th/id/OIP-C.FLdur1eFWbI4RxbP-qIx7QHaEP?w=270&h=180&c=7&r=0&o=5&dpr=1.5&pid=1.7',
                cpercentage: 70,
                children: [],
            },
            {
                id: 7,
                parentId: 0,
                created: '2021-01-16T11:57:32',
                updated: '2023-01-16T16:57:32',
                statu: '未使用',
                name: 'Fantasy 奇幻片',
                avatar:
                    'https://tse3-mm.cn.bing.net/th/id/OIP-C.7BOke3BGLKga5gvMyJ1rZQHaEK?w=201&h=113&c=7&r=0&o=5&dpr=1.5&pid=1.7',
                cpercentage: 20,
                children: [],
            },
            {
                id: 8,
                parentId: 0,
                created: '2021-01-16T11:57:32',
                updated: '2023-01-16T16:57:32',
                statu: '使用中',
                name: 'Action and Adventure 动作和冒险类',
                avatar:
                    'https://tse4-mm.cn.bing.net/th/id/OIP-C.L751Thja_nUNXdlo1G06PQHaEK?w=312&h=180&c=7&r=0&o=5&dpr=1.5&pid=1.7',
                cpercentage: 40,
                children: [],
            },
            {
                id: 9,
                parentId: 0,
                created: '2021-01-16T11:57:32',
                updated: '2023-01-16T16:57:32',
                statu: '未使用',
                name: 'Documentary 纪录片',
                avatar:
                    'https://tse2-mm.cn.bing.net/th/id/OIP-C.cq2hl1P6KWFD5xWUJVOVSQHaEJ?w=203&h=114&c=7&r=0&o=5&dpr=1.5&pid=1.7',
                cpercentage: 13,
                children: [],
            },
            {
                id: 10,
                parentId: 0,
                created: '2021-01-16T11:57:32',
                updated: '2023-01-16T16:57:32',
                statu: '未使用',
                name: 'Thriller 惊悚片',
                avatar:
                    'https://www.phbang.cn/uploads/allimg/img200414/15VOJ2O5050-113R.jpg',
                cpercentage: 18,
                children: [],
            },
            {
                id: 11,
                parentId: 0,
                created: '2021-01-16T11:57:32',
                updated: '2023-01-16T16:57:32',
                statu: '使用中',
                name: 'Musical 音乐剧',
                avatar:
                    'https://tse4-mm.cn.bing.net/th/id/OIP-C.5hVeplZbwrWViDbOA8svowHaE8?pid=ImgDet&rs=1',
                cpercentage: 70,
                children: [],
            },
        ],
        total: 11,
        size: 5,
        current: 1,
        orders: [],
        optimizeCountSql: true,
        hitCount: false,
        countId: null,
        maxLimit: null,
        searchCount: true,
        pages: 1,
    }
    return Result
})


//新建类别信息保存的方法
Mock.mock('/system/category/save', 'post', () => {
    Result.code = 20000
    Result.message = '新建类别成功'
    Result.data = null
    return Result
})

//更新类别信息
Mock.mock('/system/category/update', 'post', () => {
    Result.code = 20000
    Result.message = '更新类别成功'
    Result.data = null
    return Result
})
//根据类别的id 获得详细信息 编辑类别
Mock.mock(RegExp('/system/category/info/*'), 'get', () => {
    Result.code = 20000
    Result.message = '查询类别详细信息成功',
        Result.data =
            {
                id: 4,
                parentId: 0,
                created: '2021-01-16T11:57:32',
                updated: '2023-01-16T16:57:32',
                statu: 1,
                name: 'Science Fiction 科幻片',
                avatar:
                    'https://tse3-mm.cn.bing.net/th/id/OIP-C.WZAc7n_cxaQ7LJ92A4cqFQHaEx?w=279&h=180&c=7&r=0&o=5&dpr=1.5&pid=1.7',
                cpercentage: 19,
                children: [
                    {
                        id: 12,
                        parentId: 1,
                        created: '2021-01-16T11:57:32',
                        updated: '2023-01-16T16:57:32',
                        statu: 0,
                        name: 'Sci-fi adventure film 科幻冒险片',
                        avatar:
                            'https://tse3-mm.cn.bing.net/th/id/OIP-C.q0n-dsJW_4BdGnfbQXPFGAHaEK?w=333&h=187&c=7&r=0&o=5&dpr=1.5&pid=1.7',
                        cpercentage: 43,
                        children: [],
                    },
                    {
                        id: 13,
                        parentId: 1,
                        created: '2021-01-16T11:57:32',
                        updated: '2023-01-16T16:57:32',
                        statu: 1,
                        name: 'Sci-fi action film 科幻动作片',
                        avatar:
                            'https://tse3-mm.cn.bing.net/th/id/OIP-C.24CDNGuva2Qs7s19-kuneAHaDn?w=298&h=170&c=7&r=0&o=5&dpr=1.5&pid=1.7',
                        cpercentage: 50,
                        children: [],
                    },
                    {
                        id: 14,
                        parentId: 1,
                        created: '2021-01-16T11:57:32',
                        updated: '2023-01-16T16:57:32',
                        statu: 0,
                        name: 'Sci-fi epic film 科幻史诗片',
                        avatar:
                            'https://tse1-mm.cn.bing.net/th/id/OIP-C.VTeRO2cMbDga5uWmnabafAHaDR?w=285&h=180&c=7&r=0&o=5&dpr=1.5&pid=1.7',
                        cpercentage: 80,
                        children: [],
                    },
                    {
                        id: 15,
                        parentId: 1,
                        created: '2021-01-16T11:57:32',
                        updated: '2023-01-16T16:57:32',
                        statu: 1,
                        name: 'Sci-fi disaster film 科幻灾难片',
                        avatar:
                            'https://tse4-mm.cn.bing.net/th/id/OIP-C.H3ZrAUrxnQdm_Y6PKDUqXAHaET?w=190&h=110&c=7&r=0&o=5&dpr=1.5&pid=1.7',
                        cpercentage: 10,
                        children: [],
                    },
                ],
            }


    return Result
})
//删除类别信息
Mock.mock('/system/category/delete', 'post', () => {
    Result.code = 20000
    Result.message = '删除类别成功'
    Result.data = null
    return Result
})


//周边商品的类别信息
Mock.mock('/system/product/list', 'get', () => {
    Result.code = 20000
    Result.message = '请求类别数据成功'
    Result.data = {
        records: [
            {
                id: 1,
                name: '胡巴',
                avatar: 'https://wanju.wen361.com/ybsj/uploads/allimg/161018/1-16101QF349161.jpg',
                code: 2435231,
                statu: 1,
                sum: 50,
                remark: '胡巴是电影《捉妖记》里的小妖王,调皮捣蛋惹人喜爱。生气的时候会缩成萝卜的形状。'
            },
            {
                id: 2,
                name: '漫威联名T恤',
                avatar: 'https://pic2.zhimg.com/v2-b9238865678c3fed3fa96545a35010b5_r.jpg',
                code: 2123321,
                statu: 1,
                sum: 20,
                remark: '优衣库旗下品牌GU，推出了很多和漫威的合作款男女T恤。'
            },
            {
                id: 3,
                name: '愤怒的小鸟&铜师傅联名糖果盒',
                avatar: 'https://pica.zhimg.com/80/v2-eb0a19593572c2feabe086172d128f61_1440w.webp?source=1940ef5c',
                code: 1234001,
                statu: 0,
                sum: 0,
                remark: '糖果盒采用经典榫卯结构，5mm钢化透明玻璃盖子，质地坚硬，起到防尘防潮的作用。盒内配置可拆卸式隔层，多格设计，清洁卫生。“胖红”原型的黄铜实心小鸟把手，经纯手工颜彩手绘，色彩艳丽，为画龙点睛之笔。'
            },
        ],
        total: 3,
        size: 5,
        current: 1,
        page: 1
    }
    return Result
})
//新建商品信息保存的方法
Mock.mock('/system/product/save', 'post', () => {
    Result.code = 20000
    Result.message = '新增商品成功'
    Result.data = null
    return Result
})
//更新商品信息
Mock.mock('/system/product/update', 'post', () => {
    Result.code = 20000
    Result.message = '更新商品信息成功'
    Result.data = null
    return Result
})
//删除商品信息
Mock.mock('/system/product/delete', 'post', () => {
    Result.code = 20000
    Result.message = '删除该商品信息成功'
    Result.data = null
    return Result
})
//根据商品的id 获得详细信息 编辑商品信息
Mock.mock(RegExp('/system/product/info/*'), 'get', () => {
    Result.code = 20000
    Result.message = '查询商品详细信息成功',
        Result.data =
            {
                id: 1,
                name: '胡巴',
                avatar: 'https://wanju.wen361.com/ybsj/uploads/allimg/161018/1-16101QF349161.jpg',
                code: 20210001,
                statu: 1,
                sum: 50,
                remark: '胡巴是电影《捉妖记》里的小妖王,调皮捣蛋惹人喜爱。生气的时候会缩成萝卜的形状。'
            }

    return Result
})

Mock.mock('/system/usercenter/list', 'get', () => {
    Result.code = 20000
    Result.message = '请求用户中心数据成功'
    Result.data = {
        records: {
                id: 1,
                created: '2021-01-12T22:13:53',
                updated: '2021-01-16T16:57:32',
                statu: 1,
                username: 'admin',
                password:
                    '$2a$10$oPaOFhl1IYrUgHj3kcpW7OJYR9N9wGudceRdNVIs8aSY4Q7rLCGuK', //123123
                avatar:
                    'https://pic3.zhimg.com/v2-24c4f95ab345171dc356cc611852dfea_r.jpg',
                email: '999@qq.com',
                tel: '15343517807',
                lastLogin: '2020-12-30T08:38:37',
                roles: [
                    {
                        id: 6,
                        created: '2021-01-16T13:29:03',
                        updated: '2021-01-17T15:50:45',
                        statu: 1,
                        name: '超级管理员',
                        code: 'admin',
                        remark: '系统默认最高权限，不可以编辑和任意修改',
                        menuIds: [],
                    },
                    {
                        id: 3,
                        created: '2021-01-04T10:09:14',
                        updated: '2021-01-30T08:19:52',
                        statu: 1,
                        name: '普通用户',
                        code: 'normal',
                        remark: '只有基本查看功能',
                        menuIds: [],
                    },
                ],
            }
    }
    return Result
})

Mock.mock('/system/usercenter/update', 'post', () => {
    Result.code = 20000
    Result.message = '更改用户中心数据成功'
    Result.data = {
        records: {
            id: 1,
            created: '2021-01-12T22:13:53',
            updated: '2021-01-16T16:57:32',
            statu: 1,
            username: 'admin',
            password:
                '$2a$10$oPaOFhl1IYrUgHj3kcpW7OJYR9N9wGudceRdNVIs8aSY4Q7rLCGuK', //123123
            avatar:
                'https://pic3.zhimg.com/v2-24c4f95ab345171dc356cc611852dfea_r.jpg',
            email: '999@qq.com',
            tel: '15343517807',
            lastLogin: '2020-12-30T08:38:37',
            roles: [
                {
                    id: 6,
                    created: '2021-01-16T13:29:03',
                    updated: '2021-01-17T15:50:45',
                    statu: 1,
                    name: '超级管理员',
                    code: 'admin',
                    remark: '系统默认最高权限，不可以编辑和任意修改',
                    menuIds: [],
                },
                {
                    id: 3,
                    created: '2021-01-04T10:09:14',
                    updated: '2021-01-30T08:19:52',
                    statu: 1,
                    name: '普通用户',
                    code: 'normal',
                    remark: '只有基本查看功能',
                    menuIds: [],
                },
            ],
        }
    }
    return Result
})

//轮播图信息
Mock.mock('/system/poster/list', 'get', () => {
    const records=[];
    Result.code = 20000
    Result.message = '请求轮播图数据成功'
    Result.data = {
        records,
        total: 5,
        size: 5,
        current: 1,
        page:1
    }
    for (let i=1;i<=5;i++)
    {
        const poster=Mock.mock
        (  {
            id:i,
            name:`电影${i}`,
            avatar:'https://img0.baidu.com/it/u=148957652,2072323752&fm=253&fmt=auto&app=120&f=JPEG?w=745&h=500',
            statu:getRandomInt(0,1),
            created: Mock.Random.date('yyyy-MM-dd')+' '+Mock.Random.time('hh:mm:ss'),
            updated: Mock.Random.date('yyyy-MM-dd')+' '+Mock.Random.time('hh:mm:ss') ,});
        records.push(poster);
    }
    return Result
})
//新建轮播图信息保存的方法
Mock.mock('/system/poster/save','post',()=>{
    Result.code=20000
    Result.message='新增轮播图成功'
    Result.data=null
    return Result
})
//更新商品信息
Mock.mock('/system/poster/update','post',()=>{
    Result.code=20000
    Result.message='更新轮播图信息成功'
    Result.data=null
    return Result
})
//删除商品信息
Mock.mock('/system/poster/delete','post',()=>{
    Result.code=20000
    Result.message='删除该轮播图信息成功'
    Result.data=null
    return Result
})
Mock.mock(RegExp('/system/poster/info/*'),'get',()=>{
    Result.code=20000
    Result.message='查询轮播图详细信息成功',
        Result.data=
            {
                id:18,
                name:'阿凡达2-水之道',
                avatar:'https://img1.baidu.com/it/u=1023200226,4197865777&fm=253&fmt=auto&app=120&f=JPEG?w=550&h=307',
                statu:1,
                created: '2021-01-16T11:57:32',
                updated: '2023-01-16T16:57:32',

            }

    return Result
})








//////////////////////////////////////////////////////////////////////////////////

Mock.mock(RegExp('/system/fans/list*'), 'get', () => {
    Result.code = 20000
    Result.message = '请求粉丝数据成功'
    Result.data = {
        records: [
            {
                id: 1,
                name:1111,
                created: '2021-01-12T22:13:53',
                updated: '2021-01-16T16:57:32',
                statu: 1,
                username: 'admin',
                sex:'0',
                avatar:
                    'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fc-ssl.duitang.com%2Fuploads%2Fblog%2F202107%2F09%2F20210709142454_dc8dc.thumb.1000_0.jpeg&refer=http%3A%2F%2Fc-ssl.duitang.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1666333236&t=3733d94221afc7ea3189dc0ffa30fd47',
                email: '999@qq.com',
                tel: '15343517807',
                content:'电影评分机制十分科学，值得参考',
                is_dot:true,
            },
            {
                id: 2,
                name:1111,
                created: '2021-01-12T22:13:53',
                updated: '2021-01-16T16:57:32',
                statu: 1,
                username: 'admin',
                sex:'1',
                avatar:
                    'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fc-ssl.duitang.com%2Fuploads%2Fblog%2F202107%2F09%2F20210709142454_dc8dc.thumb.1000_0.jpeg&refer=http%3A%2F%2Fc-ssl.duitang.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1666333236&t=3733d94221afc7ea3189dc0ffa30fd47',
                email: '999@qq.com',
                tel: '15343517807',
                content:'那些不完整的构图所展现的肉体和精神的扭曲，那灰白影调所产生的雕塑般的力度美，展现了中华民族于深重灾难之中不屈的抗争精神。',
                is_dot:true,
            },
        ],
        current:1,
        total:2,
        size:1,
    }
    return Result
})

Mock.mock('/system/fans/delete', 'post', () => {
    Result.code = 20000
    Result.message = '删除粉丝数据成功'
    Result.data = null
    return Result
})

Mock.mock('/system/fans/kick', 'post', () => {
    Result.code = 20000
    Result.message = '粉丝加入黑名单成功'
    Result.data = null
    return Result
})

Mock.mock('/system/fans/save', 'post', () => {
    Result.code = 20000
    Result.message = '新建粉丝信息成功'
    Result.data = null
    return Result
})

//模拟Java服务器代码执行 更新菜单方法
Mock.mock('/system/fans/update', 'post', () => {
    Result.code = 20000
    Result.message = '更新粉丝信息成功'
    Result.data = null
    return Result
})

Mock.mock(RegExp('/fans/fansinfo/*'),'get',() => {
    Result.code = 20000
    Result.message = '查询粉丝详细信息成功'
    Result.data = {
        id: 1,
        name:1111,
        statu: 1,
        sex:0,
        avatar:
            'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fc-ssl.duitang.com%2Fuploads%2Fblog%2F202107%2F09%2F20210709142454_dc8dc.thumb.1000_0.jpeg&refer=http%3A%2F%2Fc-ssl.duitang.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1666333236&t=3733d94221afc7ea3189dc0ffa30fd47',
        email: '999@qq.com',
        tel: '15343517807',
        content:'电影评分机制十分科学，值得参考',
        is_dot:true,
    }
    return Result
})


////////////////////////////////////////////////////////////////////////

Mock.mock(RegExp('/system/comment/list*'), 'get', () => {
    Result.code = 20000
    Result.message = '请求粉丝数据成功'
    Result.data = {
        records: [
            {
                id: 1,
                movieNum:1,
                movieName: '深海',
                tel: '17727772777',
                email: '999@qq.com',
                tel: '15343517807',
                username:'111',
                value:4.5,
                content:'每一帧都是美的，故事立意很好，结尾不错。中途有些薄弱，总体推荐',
                created:'2021-01-12T22:13:53',
            },
            {
                id: 2,
                movieNum:1,
                movieName: '深海',
                tel: '17727772777',
                email: '999@qq.com',
                tel: '15343517807',
                username:'111',
                value:4.5,
                content:'比深海饭店不存在更让人难过的，是南河曾存在',
                created:'2021-01-12T22:13:53',
            },
            {
                id: 3,
                movieNum:1,
                movieName: '深海',
                tel: '17727772777',
                email: '999@qq.com',
                tel: '15343517807',
                username:'111',
                value:4.5,
                content:'不想笑你就别笑，想哭你就大声哭出来。到那个时候再也不用讨好别人，不用为别人活着',
                created:'2021-01-12T22:13:53',
            },
            {
                id: 4,
                movieNum:1,
                movieName: '深海',
                tel: '17727772777',
                email: '999@qq.com',
                tel: '15343517807',
                username:'111',
                value:4.5,
                content:'比深海饭店不存在更让人难过的，是南河曾存在',
                created:'2021-01-12T22:13:53',
            },
            {
                id: 5,
                movieNum:1,
                movieName: '深海',
                tel: '17727772777',
                email: '999@qq.com',
                tel: '15343517807',
                username:'111',
                value:4.5,
                content:'比深海饭店不存在更让人难过的，是南河曾存在',
                created:'2021-01-12T22:13:53',
            },
            {
                id: 6,
                movieNum:1,
                movieName: '深海',
                tel: '17727772777',
                email: '999@qq.com',
                tel: '15343517807',
                username:'111',
                value:4.5,
                content:'比深海饭店不存在更让人难过的，是南河曾存在',
                created:'2021-01-12T22:13:53',
            },
            {
                id: 7,
                movieNum:1,
                movieName: '深海',
                tel: '17727772777',
                email: '999@qq.com',
                tel: '15343517807',
                username:'111',
                value:4.5,
                content:'比深海饭店不存在更让人难过的，是南河曾存在',
                created:'2021-01-12T22:13:53',
            },
            {
                id: 8,
                movieNum:1,
                movieName: '深海',
                tel: '17727772777',
                email: '999@qq.com',
                tel: '15343517807',
                username:'111',
                value:4.5,
                content:'比深海饭店不存在更让人难过的，是南河曾存在',
                created:'2021-01-12T22:13:53',
            },
            {
                id: 9,
                movieNum:1,
                movieName: '深海',
                tel: '17727772777',
                email: '999@qq.com',
                tel: '15343517807',
                username:'111',
                value:4.5,
                content:'比深海饭店不存在更让人难过的，是南河曾存在',
                created:'2021-01-12T22:13:53',
            },
            {
                id: 10,
                movieNum:1,
                movieName: '深海',
                tel: '17727772777',
                email: '999@qq.com',
                tel: '15343517807',
                username:'111',
                value:4.5,
                content:'比深海饭店不存在更让人难过的，是南河曾存在',
                created:'2021-01-12T22:13:53',
            },
            {
                id: 11,
                movieNum:1,
                movieName: '深海',
                tel: '17727772777',
                email: '999@qq.com',
                tel: '15343517807',
                username:'111',
                value:4.5,
                content:'比深海饭店不存在更让人难过的，是南河曾存在',
                created:'2021-01-12T22:13:53',
            },
            {
                id: 12,
                movieNum:1,
                movieName: '深海',
                tel: '17727772777',
                email: '999@qq.com',
                tel: '15343517807',
                username:'111',
                value:4.5,
                content:'比深海饭店不存在更让人难过的，是南河曾存在',
                created:'2021-01-12T22:13:53',
            },
            {
                id: 13,
                movieNum:1,
                movieName: '深海',
                tel: '17727772777',
                email: '999@qq.com',
                tel: '15343517807',
                username:'111',
                value:4.5,
                content:'比深海饭店不存在更让人难过的，是南河曾存在',
                created:'2021-01-12T22:13:53',
            },
            {
                id: 14,
                movieNum:1,
                movieName: '深海',
                tel: '17727772777',
                email: '999@qq.com',
                tel: '15343517807',
                username:'111',
                value:4.5,
                content:'比深海饭店不存在更让人难过的，是南河曾存在',
                created:'2021-01-12T22:13:53',
            },
            {
                id: 15,
                movieNum:1,
                movieName: '深海',
                tel: '17727772777',
                email: '999@qq.com',
                tel: '15343517807',
                username:'111',
                value:4.5,
                content:'比深海饭店不存在更让人难过的，是南河曾存在',
                created:'2021-01-12T22:13:53',
            },
            {
                id: 16,
                movieNum:1,
                movieName: '深海',
                tel: '17727772777',
                email: '999@qq.com',
                tel: '15343517807',
                username:'111',
                value:4.5,
                content:'比深海饭店不存在更让人难过的，是南河曾存在',
                created:'2021-01-12T22:13:53',
            },
            {
                id: 17,
                movieNum:1,
                movieName: '深海',
                tel: '17727772777',
                email: '999@qq.com',
                tel: '15343517807',
                username:'111',
                value:4.5,
                content:'比深海饭店不存在更让人难过的，是南河曾存在',
                created:'2021-01-12T22:13:53',
            },
            {
                id: 18,
                movieNum:1,
                movieName: '深海',
                tel: '17727772777',
                email: '999@qq.com',
                tel: '15343517807',
                username:'111',
                value:4.5,
                content:'比深海饭店不存在更让人难过的，是南河曾存在',
                created:'2021-01-12T22:13:53',
            },
        ],
        total:18,
        size:5,
    }
    return Result
})

Mock.mock('/system/comment/delete', 'post', () => {
    Result.code = 20000
    Result.message = '删除评论数据成功'
    Result.data = null
    return Result
})

Mock.mock('/system/comment/save', 'post', () => {
    Result.code = 20000
    Result.message = '新建评论信息成功'
    Result.data = null
    return Result
})

//模拟Java服务器代码执行 更新菜单方法
Mock.mock('/system/comment/update', 'post', () => {
    Result.code = 20000
    Result.message = '更新评论信息成功'
    Result.data = null
    return Result
})

///////////////////////////////////////////////////////////////////////////

Mock.mock(RegExp('/system/movie/list*'), 'get', () => {
    Result.code = 20000
    Result.message = '请求粉丝数据成功'
    Result.data = {
        records: [
            {
                id: 1,
                avatar:require('@/assets/shenhai.png'),
                movieNum:1,
                movieName: '深海',
                seatNum:132,
                type:1,
                time:1234,
                price:50,
                date:'2021-01-12',
                startTime:'22:30:00',
                endTime:'24:13:00',
                statu:1,
            },
            {
                id: 2,
                avatar:require('@/assets/lingya.png'),
                movieNum:2,
                movieName: '玲芽之旅',
                seatNum:52,
                type:2,
                time:120000,
                price:68,
                date:'2023-03-29',
                startTime:'17:05:00',
                endTime:'19:13:00',
                statu:1,
            },
            {
                id: 3,
                avatar:require('@/assets/wanli.png'),
                movieNum:3,
                movieName: '万里归途',
                seatNum:102,
                type:0,
                time:5847,
                price:33,
                date:'2022-10-29',
                startTime:'13:05:00',
                endTime:'15:03:00',
                statu:0,
            },
            {
                id: 4,
                avatar:require('@/assets/dashi.png'),
                movieNum:4,
                movieName: '人生大事',
                seatNum:52,
                type:2,
                time:6627,
                price:45,
                date:'2021-11-29',
                startTime:'09:05:00',
                endTime:'11:12:00',
                statu:1,
            },
        ],
        total:4,
        size:3,
        current:1,
    }
    return Result
})

Mock.mock('/system/movie/delete', 'post', () => {
    Result.code = 20000
    Result.message = '删除电影排片数据成功'
    Result.data = null
    return Result
})

Mock.mock('/system/movie/save', 'post', () => {
    Result.code = 20000
    Result.message = '新建电影排片信息成功'
    Result.data = null
    return Result
})

Mock.mock('/system/movie/update', 'post', () => {
    Result.code = 20000
    Result.message = '更新电影排片信息成功'
    Result.data = null
    return Result
})

Mock.mock(RegExp('/movie/movieinfo/*'),'get',() => {
    Result.code = 20000
    Result.message = '查询排片详细信息成功'
    Result.data = {
        id: 1,
        avatar:require('@/assets/shenhai.png'),
        movieNum:1,
        movieName: '深海',
        seatNum:132,
        type:1,
        time:1234,
        price:50,
        date:'2021-01-12',
        startTime:'22:30:00',
        endTime:'24:13:00',
        statu:1,
    }
    return Result
})





